/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package servermba;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import java.net.*;
import java.io.*;
import java.sql.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
import servermba.mdb.ApiManeger;
import servermba.object.CreditCard;

/**
 *
 * @author lekhanhduy
 */
public class ServerMBA {

    /**
     * @param args the command line arguments
     */
   public final static int DEFAULT_PORT = 2007;

    public static void main(String[] args) {
       int port = DEFAULT_PORT;
        try {
            ServerSocket ss = new ServerSocket(port);
            InetAddress addrs = InetAddress.getLocalHost();

            System.out.println("TCP/Server running on : " + addrs + " ,Port "
                    + ss.getLocalPort());

            while (true) {
                Socket socket = ss.accept();
                try {
                    ServerThread svTh =
                            new ServerThread(socket);
                    svTh.start();
                } catch (IOException e) {

                    socket.close();
                }
            }
        } catch (IOException ex) {
            Logger.getLogger(ServerMBA.class.getName()).log(Level.SEVERE, null,
                    ex);
        }

   
       /**
         ApiManeger api = new ApiManeger(); 
         api.caculInterest("1234-4567-7890-1234", Date.valueOf("2013-12-11"));
         
        */ 
    }
}
